import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_base_util/flutter_base_util.dart';
import 'package:flutter_base_util/flutter_base_util_platform_interface.dart';
import 'package:flutter_base_util/flutter_base_util_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterBaseUtilPlatform
    with MockPlatformInterfaceMixin
    implements FlutterBaseUtilPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterBaseUtilPlatform initialPlatform = FlutterBaseUtilPlatform.instance;

  test('$MethodChannelFlutterBaseUtil is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterBaseUtil>());
  });

  test('getPlatformVersion', () async {
    FlutterBaseUtil flutterBaseUtilPlugin = FlutterBaseUtil();
    MockFlutterBaseUtilPlatform fakePlatform = MockFlutterBaseUtilPlatform();
    FlutterBaseUtilPlatform.instance = fakePlatform;

    expect(await flutterBaseUtilPlugin.getPlatformVersion(), '42');
  });
}
